home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / toolssrc / Deppars.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  4.6 KB  |  193 lines  |  [TEXT/Moml]

  1. local
  2. in
  3. datatype token =
  4.     ID of string
  5.   | EQUALS
  6.   | NULL
  7.   | OPEN
  8.   | QUAL_ID of string
  9.   | STAR
  10.   | EOF
  11. end;
  12.  
  13. open Obj Parsing;
  14. prim_val vector_ : int -> 'a -> 'a Vector.vector         = 2 "make_vect";
  15. prim_val update_ : 'a Vector.vector -> int -> 'a -> unit = 3 "set_vect_item";
  16.  
  17. open List
  18.  
  19. fun print s = BasicIO.print;
  20. fun printb s = print (s ^ " ");
  21. (* Line 10, file Deppars.sml *)
  22. val yytransl = #[
  23.   257 (* ID *),
  24.   258 (* EQUALS *),
  25.   259 (* NULL *),
  26.   260 (* OPEN *),
  27.   261 (* QUAL_ID *),
  28.   262 (* STAR *),
  29.   263 (* EOF *),
  30.     0];
  31.  
  32. val yylhs = "\255\255\
  33. \\001\000\001\000\002\000\002\000\002\000\003\000\003\000\004\000\
  34. \\004\000\006\000\006\000\007\000\007\000\005\000\005\000\000\000";
  35.  
  36. val yylen = "\002\000\
  37. \\002\000\001\000\001\000\001\000\002\000\002\000\001\000\002\000\
  38. \\000\000\001\000\001\000\001\000\001\000\001\000\001\000\002\000";
  39.  
  40. val yydefred = "\000\000\
  41. \\000\000\000\000\012\000\003\000\000\000\015\000\013\000\002\000\
  42. \\016\000\000\000\000\000\004\000\014\000\011\000\005\000\000\000\
  43. \\010\000\006\000\001\000\008\000";
  44.  
  45. val yydgoto = "\002\000\
  46. \\009\000\010\000\011\000\015\000\012\000\016\000\013\000";
  47.  
  48. val yysindex = "\001\000\
  49. \\000\255\000\000\000\000\000\000\015\255\000\000\000\000\000\000\
  50. \\000\000\009\255\001\255\000\000\000\000\000\000\000\000\015\255\
  51. \\000\000\000\000\000\000\000\000";
  52.  
  53. val yyrindex = "\000\000\
  54. \\000\000\000\000\000\000\000\000\019\255\000\000\000\000\000\000\
  55. \\000\000\002\255\000\000\000\000\000\000\000\000\000\000\019\255\
  56. \\000\000\000\000\000\000\000\000";
  57.  
  58. val yygindex = "\000\000\
  59. \\000\000\000\000\008\000\003\000\000\000\000\000\251\255";
  60.  
  61. val YYTABLESIZE = 26;
  62. val yytable = "\017\000\
  63. \\003\000\001\000\004\000\005\000\006\000\007\000\008\000\019\000\
  64. \\007\000\003\000\017\000\004\000\005\000\006\000\007\000\003\000\
  65. \\014\000\018\000\020\000\000\000\007\000\009\000\009\000\009\000\
  66. \\000\000\009\000";
  67.  
  68. val yycheck = "\005\000\
  69. \\001\001\001\000\003\001\004\001\005\001\006\001\007\001\007\001\
  70. \\007\001\001\001\016\000\003\001\004\001\005\001\006\001\001\001\
  71. \\002\001\010\000\016\000\255\255\006\001\003\001\004\001\005\001\
  72. \\255\255\007\001";
  73.  
  74. val yyact = vector_ 17 (fn () => ((raise Fail "parser") : obj));
  75. (* Rule 1, file Deppars.grm, line 17 *)
  76. val _ = update_ yyact 1
  77. (fn () => repr(let
  78. val d__1__ = peekVal 1 : string list
  79. in
  80. ( (d__1__) ) end : string list))
  81. ;
  82. (* Rule 2, file Deppars.grm, line 18 *)
  83. val _ = update_ yyact 2
  84. (fn () => repr(let
  85. in
  86. ( [] ) end : string list))
  87. ;
  88. (* Rule 3, file Deppars.grm, line 22 *)
  89. val _ = update_ yyact 3
  90. (fn () => repr(let
  91. in
  92. ( [] ) end : string list))
  93. ;
  94. (* Rule 4, file Deppars.grm, line 23 *)
  95. val _ = update_ yyact 4
  96. (fn () => repr(let
  97. val d__1__ = peekVal 0 : string list
  98. in
  99. ( (d__1__) ) end : string list))
  100. ;
  101. (* Rule 5, file Deppars.grm, line 24 *)
  102. val _ = update_ yyact 5
  103. (fn () => repr(let
  104. val d__2__ = peekVal 0 : string list
  105. in
  106. ( (d__2__) ) end : string list))
  107. ;
  108. (* Rule 6, file Deppars.grm, line 28 *)
  109. val _ = update_ yyact 6
  110. (fn () => repr(let
  111. val d__1__ = peekVal 1 : string list
  112. val d__2__ = peekVal 0 : string list
  113. in
  114. ( (d__1__) @ (d__2__) ) end : string list))
  115. ;
  116. (* Rule 7, file Deppars.grm, line 29 *)
  117. val _ = update_ yyact 7
  118. (fn () => repr(let
  119. val d__1__ = peekVal 0 : string list
  120. in
  121. ( (d__1__) ) end : string list))
  122. ;
  123. (* Rule 8, file Deppars.grm, line 33 *)
  124. val _ = update_ yyact 8
  125. (fn () => repr(let
  126. val d__1__ = peekVal 1 : string
  127. val d__2__ = peekVal 0 : string list
  128. in
  129. ( (d__1__) :: (d__2__) ) end : string list))
  130. ;
  131. (* Rule 9, file Deppars.grm, line 34 *)
  132. val _ = update_ yyact 9
  133. (fn () => repr(let
  134. in
  135. ( [] ) end : string list))
  136. ;
  137. (* Rule 10, file Deppars.grm, line 38 *)
  138. val _ = update_ yyact 10
  139. (fn () => repr(let
  140. val d__1__ = peekVal 0 : string
  141. in
  142. ( (d__1__) ) end : string))
  143. ;
  144. (* Rule 11, file Deppars.grm, line 39 *)
  145. val _ = update_ yyact 11
  146. (fn () => repr(let
  147. in
  148. ( "=" ) end : string))
  149. ;
  150. (* Rule 12, file Deppars.grm, line 43 *)
  151. val _ = update_ yyact 12
  152. (fn () => repr(let
  153. val d__1__ = peekVal 0 : string
  154. in
  155. ( (d__1__) ) end : string))
  156. ;
  157. (* Rule 13, file Deppars.grm, line 44 *)
  158. val _ = update_ yyact 13
  159. (fn () => repr(let
  160. in
  161. ( "*" ) end : string))
  162. ;
  163. (* Rule 14, file Deppars.grm, line 48 *)
  164. val _ = update_ yyact 14
  165. (fn () => repr(let
  166. val d__1__ = peekVal 0 : string
  167. in
  168. ( [] ) end : string list))
  169. ;
  170. (* Rule 15, file Deppars.grm, line 49 *)
  171. val _ = update_ yyact 15
  172. (fn () => repr(let
  173. val d__1__ = peekVal 0 : string
  174. in
  175. ( [(d__1__)] ) end : string list))
  176. ;
  177. (* Entry MLtext *)
  178. val _ = update_ yyact 16 (fn () => raise yyexit (peekVal 0));
  179. val yytables : parseTables =
  180.   ( yyact,
  181.     yytransl,
  182.     yylhs,
  183.     yylen,
  184.     yydefred,
  185.     yydgoto,
  186.     yysindex,
  187.     yyrindex,
  188.     yygindex,
  189.     YYTABLESIZE,
  190.     yytable,
  191.     yycheck );
  192. fun MLtext lexer lexbuf = yyparse yytables 1 lexer lexbuf;
  193.